<?php

/**
* Olark Module
* Chat Widget 
* Based on http://www.olark.com sevices
* 
* @author trungdt
* @since Oct 26, 2011
* 
*/

class olarkmodule {
	function name() { return 'Olark Chat Widget'; }
	function description() { return 'Olark chat widget, help support'; }
	function author() { return 'trungdt - ABSoft.vn'; }

	function hasSources() { return true; }
	function hasContent() { return false; }
	function hasViews() { return true; }

	function supportsWorkflow() { return false; }

	function permissions($internal = '') {
		return array(
			'administrate'=>"Administrate"
		);
	}
	
	function show($view,$loc = null, $title = '') {
		global $db;
		$config=$db->selectObject("olarkmodule_config", "location_data = '".serialize($loc)."'");
		
		if (isset($config->id))
		{
			$template = new template('olarkmodule',$view,$loc);

			$template->register_permissions(array('administrate'),$loc);
			$template->assign('config', $config);
			$template->assign('ticket', exponent_sessions_getTicketString());
			$template->output();
		}
	}

	function deleteIn($loc) {
		return false;
	}

	function copyContent($oloc,$nloc) {
		global $db;
		return false;
	}

	function searchName() {
		return false;
	}

	function spiderContent($item = null) {
		return false;
	}
}

?>
